﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WinFormDesigner.MyControls
{
    public partial class MyLabel : MyControl
    {
        [Browsable(true)]
        [Category("MyControl")]
        public Label Label { get; } = new Label() { AutoSize = false, Dock = DockStyle.Fill, Text = "label", TextAlign = ContentAlignment.MiddleCenter };

        public MyLabel()
        {
            InitializeComponent();

            Load += MyLabel_Load;
        }

        private void MyLabel_Load(object? sender, EventArgs e)
        {
            panel.Controls.Add(Label);

            Label.Click += Label_Click;
        }

        private void Label_Click(object? sender, EventArgs e)
        {
            PropertyGrid.SelectedObject = this;
            Focus();
        }
    }
}
